﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="BaseData_AddClothesCollocation" Codebehind="AddClothesCollocation.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <script type="text/javascript" src="../Include/Js/PopupCalendar.js"></script>
    <script type="text/javascript" src="../Include/Js/OpenWindow.js"></script>

    <script type="text/javascript">
     function GetUpProducts(path) 
        {
	        var handle = window.showModalDialog(path+'DialogBoxHostFrame.aspx?url=SelectUpProduct.aspx?p=0', window,'status:off;center=yes;edge:raised;dialogHeight:500px;dialogWidth:600px;help:0;resizable:0;scrollbar=0');	 
	        if (handle != null && handle != '' && typeof handle != 'undefined') {
	            //__doPostBack("SearchProduct",handle);
	            setValue(handle);
	        }
        }      
     function setValue(sdata)
     {
        var objdst=document.getElementById("Select1");
            for(var a=objdst.options.length;a>0;a--)
            {
                objdst.options[a-1].parentNode.removeChild(objdst.options[a-1]);
            }   
        var ar=sdata.split("|");
        for(var i=0;i<ar.length;i++)
        {
            var array=ar[i].split(",");
            var tmp=unescape(array[1]);
            var option = new Option(unescape(array[1]),array[0]);
            objdst.add(option,objdst.options.length+1);              
        }  
        jsf();
     }
     function deloption()
     {
        var objdst=document.getElementById("Select1");
        for(var a=objdst.options.length;a>0;a--)
        {
            if(objdst.options[a-1].selected)
            {
                objdst.options[a-1].parentNode.removeChild(objdst.options[a-1]);
            }
             var hd=document.getElementById("Hidden1");
            for(var i=0;i<objdst.options.length;i++)
            {
                hd.value+=objdst.options[i].value+",";
            }
        }        
     }
    function jsf()
    {
        var objdst=document.getElementById("Select1");
        var hd=document.getElementById("Hidden1");
        hd.value="";
        for(var i=0;i<objdst.options.length;i++)
        {
            hd.value+=objdst.options[i].value+",";
        }
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div align="Justify">
      <h2>新增服装搭配</h2>
       <div class="menu_bg">
        <asp:Button ID="btnSubmit" runat="server" CssClass="input_button" Text="保存" OnClick="btnSubmit_Click" />
        <asp:Button ID="btnCancel" runat="server" CssClass="input_button" Text="取消" OnClick="btnCancel_Click" />
       </div>
       <div class="juli">
       <table>
          <tr>
            <td style="font-weight:bold;">搭配名称：</td>
            <td><asp:TextBox ID="txtCollocationName" runat="server"></asp:TextBox></td>
          </tr>
          <tr>
            <td style="font-weight:bold;">是否停用：</td>
            <td><asp:RadioButton ID="rdoYes" runat="server" Text="是" GroupName="IsStop" />
        <asp:RadioButton ID="rdoNo" runat="server" Text="否" GroupName="IsStop" Checked="True" /></td>
         </tr>
          <tr>
            <td style="font-weight:bold;">搭配类型：</td>
            <td><asp:DropDownList ID="dropCollocationType" runat="server" Width="229px">
        </asp:DropDownList></td>
          </tr>
          <tr>
            <td style="font-weight:bold;">搭配图片：</td>
            <td><asp:Image ID="imgCollocation" runat="server" /></td>
          </tr>
          <tr>
          <tr>
            <td></td>
            <td><input id="File1" type="file" runat="server" />&nbsp;
        <asp:Button ID="btnUpload" runat="server" CssClass="input_button" Text="上传" OnClick="btnUpload_Click" /></td>
          </tr>
          <tr>
            <td style="font-weight:bold;">搭配描述：</td>
            <td><asp:TextBox ID="txtCollocationDescription" runat="server" Height="211px" TextMode="MultiLine"
            Width="458px"></asp:TextBox></td>
          </tr>
          <tr>
            <td style="font-weight:bold;">添加商品：</td>
            <td><a href="javascript:void(0);" class="btlj1" onclick="GetUpProducts('../');">添加商品</a>
        <a href="javascript:void(0);" class="btlj1" onclick="deloption();">删除商品</a></td>
          </tr>
          <tr>
            <td></td>
            <td><select id="Select1" multiple="true" style="width: 462px; height: 296px" runat="server"></select>
        <input id="Hidden1" type="hidden" runat="server"/></td>
          </tr>
        </table>
        </div>
        </div>
    </form>
</body>
</html>
